home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 60 / IOPROG_60.ISO / soft / c++ / gsl-1.1.1-setup.exe / {app} / src / integration / positivity.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-02  |  367 b   |  14 lines

  1. /* Compare the integral of f(x) with the integral of |f(x)|
  2.    to determine if f(x) covers both positive and negative values */
  3.  
  4. static inline int
  5. test_positivity (double result, double resabs);
  6.  
  7. static inline int
  8. test_positivity (double result, double resabs)
  9. {
  10.   int status = (fabs (result) >= (1 - 50 * GSL_DBL_EPSILON) * resabs);
  11.  
  12.   return status;
  13. }
  14.